/**
 * 封装 axios 请求模块
 */
 import axios from "axios"
 import store from "@/store"


 const request = axios.create({
   baseURL: "http://toutiao.itheima.net" // 基础路径
 })
 

 request.interceptors.request.use(function(config){
  if(store.state.user){
    config.headers.Authorization=`Bearer ${store.state.user.token}`
  }
  return config
 })
 export default request